package com.auxgroup.bridge.app.inner.vo;

import com.auxgroup.smarthome.utils.NewDateUtils;
import com.fasterxml.jackson.annotation.JsonGetter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 家庭分享中心
 * @Author: laiqiuhua.
 * @Date: 2017/9/5 14:04.
 */
@ApiModel("家庭分享中心")
public class FamilyShareListVo {
    @ApiModelProperty("用户id")
    private String uid;
    @ApiModelProperty("批次号")
    private String qrBatch;
    @ApiModelProperty("用户名")
    private String username;
    @ApiModelProperty("用户标签，0：主人，1：家人，2：好友")
    private int userTag;
    @ApiModelProperty("过期时间")
    private long expiredAt;
    @ApiModelProperty("分享总台数")
    private long shareTotal;

    public FamilyShareListVo(){}

    public FamilyShareListVo(String uid, String username, int userTag, long shareTotal) {
        this.uid = uid;
        this.username = username;
        this.userTag = userTag;
        this.shareTotal = shareTotal;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getUserTag() {
        return userTag;
    }

    public void setUserTag(int userTag) {
        this.userTag = userTag;
    }

    public long getExpiredAt() {
        return expiredAt;
    }

    public void setExpiredAt(long expiredAt) {
        this.expiredAt = expiredAt;
    }

    public long getShareTotal() {
        return shareTotal;
    }

    public void setShareTotal(long shareTotal) {
        this.shareTotal = shareTotal;
    }

    public String getQrBatch() {
        return qrBatch;
    }

    public void setQrBatch(String qrBatch) {
        this.qrBatch = qrBatch;
    }

    /**
     * 返回服务器当前时间戳，防止app更改系统时间
     * @return
     */
    @ApiModelProperty("服务器当前时间戳，10位精确到秒")
    @JsonGetter
    public Long getCurrentTimestamp() {
        return NewDateUtils.getCurrentInstant().getEpochSecond();
    }

}
